<div ng-include src="'tpl/public/header.html?1'"></div>
<div class="contents">
  <ol class="breadcrumb">
    <li> <a href="#/index/panel">首页</a> </li>
    <li class="active">{{pathText}}
    </li>
  </ol>
  <span ng-if="product.outProductId">外场</span>
  <form class="form-horizontal" role="form" name="form" novalidate ng-submit="save()">

    <input type="hidden" ng-model="product.outProductId">
     <div class="form-group">
      <label class="col-sm-2 control-label">
      </label>
      <span  class="col-sm-1">
        <input type="checkbox" ng-model="product.flagZhiding">置顶
      </span>
      <span class="col-sm-1">
        <input type="checkbox" ng-model="product.flagBaoxiao">包销
      </span>
      <span class="col-sm-1">
        <input type="checkbox" ng-model="product.flagZhutui">主推
      </span>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pName.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        产品简称
      </label>
      <div class="col-sm-5">
        <input type="text" class="form-control" autocomplete="off" value="" name="pName" ng-model="product.pName" required="required" placeholder="产品简称">
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pFullName.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        产品全称
      </label>
      <div class="col-sm-5">
        <input type="text" class="form-control" autocomplete="off" value="" name="pFullName" ng-model="product.pFullName" required="required" placeholder="产品全称">
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pInvestOwner.$invalid}">
      <label class="col-sm-2 control-label">
        发行机构
      </label>
      <div class="col-sm-5">
        <input type="text" class="form-control" id="pInvestOwner" name="pInvestOwner" ng-model="product.pInvestOwner" placeholder="发行机构" ng-change="showJigouCompany(product.pInvestOwner)" ng-keyup="keyupChange($event)" autocomplete="off">
           <div class="sanfang-company" style="width: 460px;" ng-show="isShowSelectCompany">
            <ul>
              <li ng-repeat="c in sfCompanyList | filter:product.pInvestOwner" ng-click="selectedJigouCompany(c.pInvestOwner)">{{c.pInvestOwner}}</li>
            </ul>
          </div>
      </div>
    </div>
 

    <div class="form-group" ng-class="{'has-error':form.pPublicArea.$invalid}">
      <label class="col-sm-2 control-label">发行地区</label>
      <div class="col-sm-5">
        <select class="form-control" name="pPublicArea" ng-model="product.pPublicArea" ng-options="m.value as m.text for m in pPublicAreaModel" required="required" placeholder="发行地区"> </select> 
      </div>
    </div>
<!--
    <div class="form-group" ng-class="{'has-error':form.pBelongArea.$invalid}">
      <label class="col-sm-2 control-label">所在地区</label>
      <div class="col-sm-5">
        <select class="form-control" name="pBelongArea" ng-model="product.pBelongArea" ng-options="m.value as m.text for m in dictMap.pbelongAreaModel" required="required" placeholder="所在地区"> </select> 
      </div>
    </div>
-->
    <div class="form-group" ng-class="{'has-error':form.pAllIssuingScale.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        发行规模
      </label>
      <div class="col-sm-5">
        <input type="number" class="form-control" autocomplete="off" value="" name="pAllIssuingScale" ng-model="product.pAllIssuingScale" required="required" placeholder="发行规模,请填写数字，单位亿元">
        <span class="form-control-feedback">亿元</span>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.peManageOrg.$invalid}">
      <label class="col-sm-2 control-label">
        管理机构
      </label>
      <div class="col-sm-5">
        <input type="text" class="form-control" name="peManageOrg" ng-model="product.peManageOrg" placeholder="管理机构">
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.peOrganizeShape.$invalid}">
      <label class="col-sm-2 control-label"><span class="required">*</span>组织形式</label>
      <div class="col-sm-5">
        <select class="form-control" placeholder="组织形式" ng-model="product.peOrganizeShape" name="peOrganizeShape" ng-options="m.value as m.text for m in dictMap.pevczzxsModel" required="required"></select>
      </div>
    </div> 

    <div class="form-group" ng-class="{'has-error':form.peFundShape.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        基金类型
      </label>
      <div class="col-sm-5">
        <input type="text" class="form-control" maxlength="8" name="peFundShape" ng-model="product.peFundShape" placeholder="基金类型" required="required" >
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pSaleTimeStartStr.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        起售时间
      </label>
      <div class="col-sm-5">
        <input type="date" class="form-control" autocomplete="off" value="" name="pSaleTimeStartStr" ng-model="product.pSaleTimeStartStr" required="required" placeholder="起售时间,格式如2014-09-01" ng-pattern="/^\d{4}-\d{2}-\d{2}$/">
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pMinimumAmountTmp.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        产品起购金额
      </label>
      <div class="col-sm-5">
        <input type="number" class="form-control" autocomplete="off" value="" name="pMinimumAmount" ng-model="product.pMinimumAmountTmp" required="required" placeholder="产品起购金额,请填写数字,单位万元">
        <span class="form-control-feedback">万元</span>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pProgressiveAmount.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        累进追加金额最小值
      </label>
      <div class="col-sm-5">
        <input type="number" class="form-control" autocomplete="off" value="" name="pProgressiveAmount" ng-model="product.pProgressiveAmountTmp" required="required" placeholder="累进追加金额最小值,请填写数字，单位万元">
        <span class="form-control-feedback">万元</span>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.peSubscriptionFee.$invalid}">
      <label class="col-sm-2 control-label">
        认购费(不需要加%)
      </label>
      <div class="col-sm-5">
        <input type="text" maxlength="8" ng-pattern="/^\d+(\.\d+)?$/" class="form-control" name="peSubscriptionFee" ng-model="product.peSubscriptionFee" placeholder="无需再后面添加%"  >
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.peManagementExpense.$invalid}">
      <label class="col-sm-2 control-label">
        管理费(不需要加%)
      </label>
      <div class="col-sm-5">
        <input type="text" maxlength="8" ng-pattern="/^\d+(\.\d+)?$/" class="form-control" name="peManagementExpense" ng-model="product.peManagementExpense" placeholder="无需再后面添加%"  >
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.peRevenueSharing.$invalid}">
      <label class="col-sm-2 control-label">
        收益分成(不超过200字)
      </label>
      <div class="col-sm-5">
        <textarea maxlength="200" class="form-control" name="peRevenueSharing" ng-model="product.peRevenueSharing" placeholder="收益分成"  ></textarea>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pDueTime.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        产品期限
      </label>
      <div class="col-sm-5">
        <input type="number" class="form-control" autocomplete="off" value="" name="pDueTime" ng-model="product.pDueTime" required="required" placeholder="产品期限,请填写数字,单位月">
        <span class="form-control-feedback">月</span>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pDueTimeDes.$invalid}">
      <label class="col-sm-2 control-label">
        产品期限说明
      </label>
      <div class="col-sm-5">
        <input type="text" class="form-control" autocomplete="off" value="" name="pDueTimeDes" ng-model="product.pDueTimeDes" placeholder="将会前台产品期限显示,例如:2+3年">
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.tjzl.$invalid}">
      <label class="col-sm-2 control-label"> 
        <span class="required">*</span>提交资料</label>
        <div class="col-sm-5">
          <label ng-repeat="tjzlitem in dictMap.tjzlModel">
            <input type="checkbox" name="tjzl" ng-model="allTjzls[tjzlitem.value]" value="{{tjzlitem.value}}">
            {{tjzlitem.text}}
          </label>
        </div>
      </div>

      <div class="form-group" ng-class="{'has-error':form.pEndEarlyIdentification.$invalid}">
        <label class="col-sm-2 control-label">项目是否可以提前结束</label>
        <div class="col-sm-5">
          <select class="form-control" name="pEndEarlyIdentification" ng-model="product.pEndEarlyIdentification" ng-options="m.value as m.text for m in dictMap['pEndEarlyIdentification']" required="required" placeholder=""> </select>
        </div>
      </div>

      <!--产品供应方公司，新加-->
      <div class="form-group" ng-class="{'has-error':form.pAccessId.$invalid}">
        <label class="col-sm-2 control-label">
          <span class="required">*</span>
          产品供应方公司
        </label>
        <div class="col-sm-5">
          <input class="form-control" ng-model="queryAccessCompany"  style="float: left;width: 30%;" id="queryAccessCompany"  ng-keyup="keyupChange($event,'ac')" autocomplete="off"></input> 
          <select class="form-control" style="float: left;width: 30%;"  id="pAccessId" name="pAccessId" ng-model="product.pAccessId" ng-options="m.id as m.accessCompany for m in supplierListOfProduct" required="required" ng-change="onSelectChange()" placeholder="产品供应方公司"></select> 
        </div>
      </div>
      <div class="form-group" ng-class="{'has-error':form.pAccessId.$invalid}">
        <label class="col-sm-2 control-label">
          <span class="required">*</span>
          对接人
        </label>
        <div class="col-sm-5">
          <input type="text" class="form-control" readonly value="{{accessNameOfCompany}}" placeholder="对接人">
        </div>
      </div>

      <div class="form-group" ng-class="{'has-error':form.peCompanyDescription.$invalid}">
        <label class="col-sm-2 control-label">
        <span class="required">*</span>
        机构/基金公司描述<br/>
        (不超过150字)
        </label>
        <div class="col-sm-5">
          <textarea class="form-control" maxlength="150" name="peCompanyDescription" ng-model="product.peCompanyDescription" required="required" placeholder="机构/基金公司描述"></textarea>
        </div>
      </div>

      <div class="form-group" ng-class="{'has-error':form.title.$invalid}">
        <label class="col-sm-2 control-label">
          <span class="required">*</span>
          产品简介
        </label>
        <div class="col-sm-7">
          <div class="ueditor" config="config" ready="ready" ng-model="product.pSummary" style="height:300px;width:1000px;" required></div>
        <!--
        <textarea class="form-control" name="pSummary" ng-model="product.pSummary" required="required"></textarea>
      -->
    </div>
  </div>

    <!--
    <div class="form-group" ng-class="{'has-error':form.pType.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        产品类型
      </label>
      <div class="col-sm-5">
        <select class="form-control" ng-model="product.pType" ng-options="m.value as m.text for m in productTypeModel" required="required"> </select> 
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pRecruitmentSummary.$invalid}">
      <label class="col-sm-2 control-label">
        <span class="required">*</span>
        募集进度说明
      </label>
      <div class="col-sm-5">
        <textarea class="form-control" name="pRecruitmentSummary" ng-model="product.pRecruitmentSummary" required="required" placeholder="募集进度说明"></textarea>
      </div>
    </div>-->

  <div class="form-group" ng-class="{'has-error':form.pImageUri.$invalid}">
    <label for="advertLinkInput" class="col-sm-2 control-label">
      产品列表图片(180*180)
    </label>
    <div class="col-sm-5">
      <input type="text" readonly="true" class="form-control" id="advertLinkInput" placeholder="产品列表图片" name="pImageUri" ng-model="product.pImageUri">
      <div class="btn btn-primary add-pic-btn">上传图片</div>
    </div>
  </div>

    <div class="form-group">
      <label class="col-sm-2 control-label"></label>
      <div class="col-sm-5">
        <img ng-src="{{staticHost}}{{product.pImageUri}}" />
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.peLogoUri.$invalid}">
      <label for="advertLinkInput" class="col-sm-2 control-label">
        公司logo上传(108*118)
      </label>
      <div class="col-sm-5">
        <input type="text" readonly="true" class="form-control" id="advertLinkInput" placeholder="产品列表图片" name="peLogoUri" ng-model="product.peLogoUri">
        <div class="btn btn-primary add-pic-btn">上传图片</div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"></label>
      <div class="col-sm-5">
        <img ng-src="{{staticHost}}{{product.peLogoUri}}" />
      </div>
    </div>

     <div class="form-group" ng-class="{'has-error':form.peHomeLogoUri.$invalid}">
      <label for="advertLinkInput" class="col-sm-2 control-label">
        首页logo上传(248*97)
      </label>
      <div class="col-sm-5">
        <input type="text" readonly="true" class="form-control" id="advertLinkInput" placeholder="产品列表图片" name="peHomeLogoUri" ng-model="product.peHomeLogoUri">
        <div class="btn btn-primary add-pic-btn">上传图片</div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"></label>
      <div class="col-sm-5">
        <img ng-src="{{staticHost}}{{product.peHomeLogoUri}}" />
      </div>
    </div>

    <div class="form-group" >
      <label class="col-sm-2 control-label">&nbsp;</label>
      <div class="col-sm-5">
        <input type="submit" class="btn btn-primary" value="保存" has-auth where="btn" who="PRODUCT_EDIT" owner="{{product.createBy}}"/>
      </div>
    </div>

  </form>
</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?5'" call-back="" charset="utf-8" ></div>